/* gm_display.h -- Mostra as informações de jogo no terminal
 *
 * Copyright (C) 2008, Diogo F. S. Ramos <diogo.ramos@usp.br>
 * GEAR - Grupo de Estudos Avançados em Robótica
 * <http://www.sel.eesc.usp.br/gear>
 *
 * This file is part of GEARMedula.
 * 
 * GEARMedula is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, version 3 of the
 * License.
 * 
 * GEARMedula is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see
 * <http://www.gnu.org/licenses/>.
 */

#ifndef GM_DISPLAY_H_
#define GM_DISPLAY_H_

#include <pthread.h>
#include <ncurses.h>

#include "gm_monitor.h"

typedef struct gm_display_t gm_display_t;

struct gm_display_t
{
    int enable;
    pthread_mutex_t enable_mutex;
    pthread_t display_thread;

    /* Informações do mundo */
    int world_size;
    float * world;
    int w_x0_pos;
    int w_y0_pos;
    int w_x_inc;
    int world_nlines;
    int world_startx;

    /* Informações dos objetos em campo */
    int field_size;
    float * field;
    int f_x0_pos;
    int f_y0_pos;
    int f_x_inc;
    int field_nlines;
    int field_startx;

    /* windows */
    WINDOW * world_window;
    WINDOW * field_window;
    WINDOW * errinf_window;

    /* monitor */
    gm_monitor_t * monitor;
};

gm_display_t * gm_display_new( gm_monitor_t * monitor);
void gm_display_destroy( gm_display_t * self );
void gm_display_init( gm_display_t * self );

#endif	/* GM_DISPLAY_H_ */
